﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Entities.TBKN;

namespace WindowsForms.TBKN
{
    public partial class InKhieuNai : Form
    {
        public InKhieuNai()
        {
            InitializeComponent();
            LoadCbbKhieuNai(KhieuNai.Objects.All().ToList());
        }
        public void LoadCbbKhieuNai(List<KhieuNai> list)
        {
            foreach (var item in list)
                cbbMaKN.Items.Add(item);
            cbbMaKN.DisplayMember = "MaKhieuNai";
            cbbMaKN.ValueMember = "MaKhieuNai";
            cbbMaKN.Items.Insert(0, "-----Chọn khiếu nại------");
            cbbMaKN.SelectedIndex = 0;
        }

        private void InKhieuNai_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'datasetQLGiaiBongda.InKhieuNai' table. You can move, or remove it, as needed.
            
        }

        private void btnIn_Click(object sender, EventArgs e)
        {
            this.inKhieuNaiTableAdapter.Fill(this.datasetQLGiaiBongda.InKhieuNai,cbbMaKN.Text);

            this.reportViewer1.RefreshReport();
        }
    }
}
